<%@ page import="projetstackoverflow.Answer" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'answer.label', default: 'Answer')}" />
		<title><g:message code="default.edit.label" args="[entityName]" /></title>
	</head>
	<body>
		<div id="create-question" class="content scaffold-update" role="main">
			<g:form method="post" >
				<div id="title-field">
					<div id="title-label"><h4>${message(code: 'default.title.label')}</h4></div>
					<g:textField name="title" value="${answerInstance.question.title}" disabled="true"/>
				</div>
				<div id="title-field">
					<div id="question-label"><h4>${message(code: 'default.question.label')}</h4></div>
					<g:textArea name="question" value="${answerInstance.question.content}" disabled="true" style="width:95%;"/>
				</div>
				<br /><br />
				<h4>${message(code: 'default.answers.yourAnswer')}</h4>
				<div id="content-field">
					<g:textArea required="" name="content" value="${answerInstance?.content}"/>
						
				</div>
				<g:hiddenField name="id" value="${answerInstance?.id}" />
				<g:hiddenField name="version" value="${answerInstance?.version}" />
				<g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
			</g:form><br /><br />
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${answerInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${answerInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			
		</div>
	</body>
</html>
